package com.winit.issue.repository;

import com.winit.issue.model.Issue;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface IssueRepository extends CrudRepository<Issue, String> {
    @Query(value = "select * from matrix_issue where need_id=?1",nativeQuery = true)
    List<Issue> findByNeedId(String needId);
    @Query(value = "SELECT * FROM  matrix_issue WHERE id IN (?1) ORDER BY FIND_IN_SET(id, ?2) ASC ", nativeQuery = true)
    List<Issue> findByIdIn(List<String> issueIds, String issues);
}
